package com.zhuss.controller.product;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.product.preline.DetailPrelineBo;
import com.zhuss.bean.bo.product.preline.SearchPrelineBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.ReadService;
import com.zhuss.product.preline.PrelineReadServiceExt;
import com.zhuss.exception.DzcxException;


/**
 * @description: 招募查询Controller
 * @author: mkh
 * @create: Mon Jan 04 13:38:02 CST 2021
 **/
@RestController
@RequestMapping("/preline")
public class PrelineReadController extends BaseController {
	
	@Autowired
	@Qualifier("prelineReadService")
	private ReadService<Object, Object> prelineReadService;
	
	@Autowired
	@Qualifier("prelineReadServiceExt")
	private PrelineReadServiceExt prelineReadServiceExt;
	
	/**
	 * 详情
	 * @param bo
	 * @return
	 * @throws DzcxException
	 */
	@ResponseBody
	@RequestMapping("/detail")
    public Object detail(@RequestBody DetailPrelineBo bo) throws DzcxException {
		
		Object result = prelineReadService.detail(bo);
		return result;
    }
	
	/**
	 * 列表
	 * @param bo
	 * @return
	 * @throws DzcxException
	 */
	@ResponseBody
    @RequestMapping("/list")
    public Object list(@RequestBody SearchPrelineBo bo) throws DzcxException {
		
		Object result = prelineReadService.list(bo);
		return result;
    }

	/**
	 * 根据lineId查看绑定的站点
	 */
	@ResponseBody
	@RequestMapping("/bindList")
	public Object bindSiteList(@RequestBody DetailPrelineBo bo) throws DzcxException {
		Object result = prelineReadServiceExt.bindSiteList(bo);
		return result;
	}
}
